package com.dtflys.forest.testserver.controller;

import com.dtflys.forest.testserver.client.XmlClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
public class TestXmlController {

    @Resource
    private XmlClient xmlClient;

    @GetMapping("/get-xml-students")
    public Map getXmlStudents() {
        String result = xmlClient.getStudents();
        Map map = new HashMap();
        map.put("results", result);
        map.put("status", "ok");
        System.out.println(result);
        return map;
    }

}
